import 'package:flutter/material.dart';
import 'package:flutter_app/Search/SearchBar.dart';
import 'package:flutter_app/Search/SearchInput.dart';
import 'package:flutter_app/components/swiper_button.dart';
import 'package:flutter_app/components/team_community.dart';
import 'package:flutter_app/mains.dart';

class Home extends StatefulWidget {
  Home({Key? key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height * 0.19,
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage(
                "image/headBg.png",
              ),
              fit: BoxFit.cover,
            ),
          ),
          child: Scaffold(
              backgroundColor: Colors.transparent, //把scaffold的背景色改成透明
              appBar: AppBar(
                elevation: 0.0,
                automaticallyImplyLeading: false,
                // centerTitle: true,
                backgroundColor: Colors.transparent, //把appbar的背景色改成透明
                // elevation: 0,//appbar的阴影
                title: SearchBar(
                    logo: '',
                    getLocation: '郑州市二七区',
                    goBackCallback: () {},
                    inputValue: '',
                    onCancel: () {},
                    onSearch: () {},
                    currentWeather: true),
              ),
              body: Column(
                children: <Widget>[SearchInput()],
              )),
        ),
        Container(
          margin: EdgeInsets.only(top: 15.0),
          child: SwiperButton(),
        ),
        Container(
          padding: EdgeInsets.only(top: 15.0),
          child: TeamCommucity(),
        )
        // Container(
        //   margin: EdgeInsets.only(top: 10.0),
        //   width: MediaQuery.of(context).size.width,
        //   height: MediaQuery.of(context).size.height * 0.454,
        //   decoration: BoxDecoration(color: Colors.lightBlue),
        //   child: MyApp(),
        // )
      ],
    );
  }
}
